#ifndef LASTVIDEO_H
#define LASTVIDEO_H

#include <QObject>
#include <opencv2/opencv.hpp>
#include <QDebug>
#include <QPair>
#include <QMap>
#include <QTimer>
#include <QMutex>

class lastVideo : public QObject
{
    Q_OBJECT
public:
    explicit lastVideo(QObject *parent = nullptr);
    ~lastVideo();

    bool cutVideo(const QString &inputVideoPath, const QString &outputVideoPath, int a, int b);

    void setfile(QPair<QPair<QString,QString>,QPair<int,int>> file);
    //视频帧率
    double getVideoFPS(const std::string& videoPath);
    //视频总帧率
    int getTotalFrames(const std::string& videoPath);
    void startRun();
    void exit();


private:
    QList<QPair<QPair<QString,QString>,QPair<int,int>>> listfile;
    QTimer *m_timer;
    QMutex listfileMutex;
    bool start = true;
    bool exitFlag = false;
};

#endif // LASTVIDEO_H
